<!--<a href="#" editable-text="user.name">{{ user.name || "empty" }}</a>-->
<!--<a href="#" editable-textarea="user.desc" e-rows="7" e-cols="40">-->
  <!--<pre>{{ user.desc || 'no description' }}</pre>-->
<!--</a>-->
<div class="container" style="overflow-y: auto">
  <div class="col-md-9 col-md-offset-2">
    <h1>文档编辑</h1>
    <div class="preview">
      <h2 class="title"><a href="#" editable-text="report.title" e-required>{{report.title || "系统分析报告"}}</a></h2>
      <div class="date"><a href="#" editable-text="report.date">{{report.date || "2000.01.01"}}</a></div>
      <div ng-repeat="obj in report.content" class="segment">
        <button class="btn delete-btn" ng-click="delete($index)">&times;</button>
        <div class="btn-group insert-btn">
          <button type="button" class=" btn btn-default dropdown-toggle" data-toggle="dropdown">
            插入 &gt;
          </button>
          <ul class="dropdown-menu" role="menu">
            <li><a ng-click="insert('sub-title',$index)">分标题</a></li>
            <li><a ng-click="insert('text',$index)">文本栏</a></li>
            <li class="divider" ></li>
            <li><a ng-click="insert('pic',$index)">图片</a></li>
            <li><a ng-click="insert('pic-desc',$index)">图片名称</a></li>
            <li class="divider" ></li>
            <li><a ng-click="insert('empty',$index)">空行</a></li>
          </ul>
        </div>
        <div ng-switch on="obj.type">
          <div class="animate-switch" ng-switch-when="sub-title" ng-class="obj.type">
            <h2>
              <a href="#" editable-text="obj.data">{{obj.data || ""}}</a>
            </h2>
          </div>
          <div class="animate-switch" ng-switch-when="text" ng-class="obj.type">
            <a href="#" editable-textarea="obj.data" e-rows="15" e-cols="100">
              <pre>{{obj.data || ""}}</pre>
            </a>
          </div>
          <div class="animate-switch" ng-switch-when="pic" ng-class="obj.type">
            <div ng-repeat="item in obj.uploader.queue">
              <div ng-show="obj.uploader.isHTML5" ng-thumb="{ file: item.file, height: 400 }"></div>
              <span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i>上传成功</span>
            </div>
            <!--<img src="" alt="" width="400px" height="400px"/><br/>-->

            <!--<a href="#" editable-text="obj.data">{{obj.data || ""}}</a>-->
            <div class="form-group" style="text-align: left;" ng-show="!obj.uploader || obj.uploader.queue.length == 0" >
              <label>图片上传 支持jpg/png/bmp</label>
            <input ng-file-select type="file" onmousedown="angular.element(this).scope().bindUploader(angular.element(this).scope())"/>
            </div>

          </div>
          <div class="animate-switch" ng-switch-when="pic-desc" ng-class="obj.type">
            <a href="#" editable-text="obj.data">{{obj.data || ""}}</a>
          </div>
          <div class="animate-switch" ng-switch-when="empty" ng-class="obj.type">
            <p><br/></p>
          </div>
          <div class="animate-switch" ng-switch-default>default</div>
        </div>

      </div>
      <!--<div class="sub-title">-->
        <!--<h2>-->
          <!--<a href="#" editable-text="report.content[0].data">{{report.content[0].data || ""}}</a>-->
        <!--</h2>-->
      <!--</div>-->
      <!--<div class="text">-->
        <!--< a href="#" editable-textarea="report.content[1].data" e-rows="15" e-cols="140">-->
          <!--<pre>{{report.content[1].data || ""}}</pre>-->
        <!--</a>-->
      <!--</div>-->
      <!--<div class="pic">-->
        <!--<img src="/images/8087646.jpg" alt="" width="400px" height="400px"/>-->
      <!--</div>-->
      <!--<div class="pic-desc">-->
        <!--<a href="#" editable-text="report.content[2].data">{{report.content[2].data || ""}}</a>-->
      <!--</div>-->
    </div>
    <div class="btn-group insert-btn" style="left:-80px;top:-20px;">
      <button type="button" class=" btn btn-default dropdown-toggle" data-toggle="dropdown">
        插入 &gt;
      </button>
      <ul class="dropdown-menu" role="menu">
        <li><a ng-click="insert('sub-title',report.content.length)">分标题</a></li>
        <li><a ng-click="insert('text',report.content.length)">文本栏</a></li>
        <li class="divider" ></li>
        <li><a ng-click="insert('pic',report.content.length)">图片</a></li>
        <li><a ng-click="insert('pic-desc',report.content.length)">图片名称</a></li>
        <li class="divider" ></li>
        <li><a ng-click="insert('empty',report.content.length)">空行</a></li>
      </ul>
    </div>

    <hr/>

    <button class="btn btn-primary" ng-click="build()">生成</button>
  </div>

</div>
